package com.im.partchat.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;

import com.im.partchat.R;
import com.im.partchat.adapter.base.XRecyclerViewAdapter;
import com.im.partchat.adapter.base.XViewHolder;

import java.util.List;

/**
 * Created by flyou on 2017/6/30.
 * VersionCode: 1
 * Desc:
 */

public class MyFooterAdapter extends XRecyclerViewAdapter<FootBean> {
    private Context context;
    public MyFooterAdapter(Context context, @NonNull RecyclerView mRecyclerView, List<FootBean> dataLists) {
        super(mRecyclerView, dataLists,R.layout.view_my_footer_item);
        this.context=context;
    }

    @Override
    protected void bindData(XViewHolder holder, final FootBean data, final int position) {

        holder.setText(R.id.tv_title,data.getTitle());
        holder.setText(R.id.tv_time,data.getTime());
        String subTitle1 = data.getSubTitle1();
        if (TextUtils.isEmpty(subTitle1)){
            holder.setVisible(R.id.tv_oper1,false);
        }else {
            holder.setVisible(R.id.tv_oper1,true);
            holder.setText(R.id.tv_oper1, subTitle1 );
        }

        String subTitle2 = data.getSubTitle2();
        if (TextUtils.isEmpty(subTitle2)){
            holder.setVisible(R.id.tv_oper2,false);
        }else {
            holder.setVisible(R.id.tv_oper2,true);
            holder.setText(R.id.tv_oper2, subTitle2 );
        }


    }
}
